/**
 * 甘特图工具类型定义
 */

import { Ref } from 'vue'

/**
 * 仿真数据接口
 */
export interface SimulationData {
  currentDate: string
  currentTime: string
}

/**
 * 航点类型
 */
export type WaypointType = 'AIRPORT' | 'ENTRY_POINT' | 'EXIT_POINT' | 'HOVER_POINT'

/**
 * 航点接口
 */
export interface Waypoint {
  type: WaypointType
  time: string
  label?: string
  location?: string
}

/**
 * 任务节点接口
 */
export interface TaskNode {
  id: string
  name: string
  expanded?: boolean
  checked?: boolean
  waypoints?: Waypoint[]
  children?: TaskNode[]
  detail?: Record<string, any>
}

/**
 * 扁平化行接口
 */
export interface FlattenedRow extends TaskNode {
  level: number
  isGroup: boolean
}

/**
 * 时间范围接口
 */
export interface TimeRange {
  min: number
  max: number
}

/**
 * 时间刻度接口
 */
export interface TimeTick {
  label: string
  dayLabel: string
  left: number
  isMajor: boolean
}

/**
 * 甘特图数据接口
 */
export interface GanttData {
  simulation: SimulationData
  rawTasks: TaskNode[]
  _updateTrigger: number
}

/**
 * 计算属性依赖接口
 */
export interface ComputedDependencies {
  ganttData: GanttData
  selectedTopScale: Ref<string>
  selectedBottomScale: Ref<string>
  containerWidth: Ref<number>
}
